<template>
  <div>
    <el-card shadow="hover">
      学生状态说明：1、已报名 2、已缴费 3、已注册
    </el-card>
    <!--分割线-->
    <el-divider/>
    <el-table style="width: 100%" :data="tableData">
      <el-table-column label="报名号" prop="no" width="100"/>
      <el-table-column label="姓名" prop="name"  width="100"/>
      <el-table-column label="专业" prop="major"  width="200"/>
      <el-table-column label="身份证号" prop="cardno"  width="250"/>
      <el-table-column label="手机号" prop="phone"  width="200"/>
      <el-table-column label="状态" prop="status"  width="200"/>
      <el-table-column align="right">
        <template #header>
          <el-input v-model="search" placeholder="请输入查询内容" class="input-with-select">
            <template #prepend>
              <el-select v-model="select" placeholder="请选择" style="width: 150px">
                <el-option label="姓名" value="1"></el-option>
                <el-option label="报名号" value="2"></el-option>
                <el-option label="身份证号" value="3"></el-option>
                <el-option label="手机号" value="4"></el-option>
                <el-option label="缴费情况" value="5"></el-option>
              </el-select>
            </template>
            <template #append>
              <el-button icon="el-icon-search"></el-button>
            </template>
          </el-input>
        </template>
        <template #default="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">学生详情</el-button>
          <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 对话框 -->
    <el-dialog v-model="dialogVisible" title="学生详情" width="50%">
      <el-steps :active="current.status" finish-status="success" simple style="margin-top: 20px">
        <el-step title="招办报名"></el-step>
        <el-step title="财务缴费"></el-step>
        <el-step title="系部确认"></el-step>
        <el-step title="教务注册"></el-step>
      </el-steps>
      <!--学生信息-->
      <el-descriptions class="margin-top" :column="3" border>
        <el-descriptions-item label-align="center">
          <template #label>姓名</template>
          {{ current.name }}
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>身份证号码</template>
          {{ current.cardno }}
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>专业</template>
          {{ current.major }}
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>报名号</template>
          {{ current.no }}
        </el-descriptions-item>
        <el-descriptions-item span="2" label-align="center">
          <template #label>家庭住址</template>
          {{ current.address }}
        </el-descriptions-item>
      </el-descriptions>
      <!--分割线-->
      <el-divider />
      <!--家长信息-->
      <el-descriptions :column="3" border title="家长信息">
        <template #extra>
          <el-button type="primary" size="small" @click="saveParent">保存</el-button>
        </template>
        <el-descriptions-item label-align="center">
          <template #label>父亲</template>
          <el-input v-model="current.fatherName"/>
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>身份证号</template>
          <el-input v-model="current.fartherCard"/>
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>联系电话</template>
          <el-input v-model="current.fatherPhone"/>
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>母亲</template>
          <el-input v-model="current.motherName"/>
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>身份证号</template>
          <el-input v-model="current.motherCard"/>
        </el-descriptions-item>
        <el-descriptions-item label-align="center">
          <template #label>联系电话</template>
          <el-input v-model="current.motherPhone"/>
        </el-descriptions-item>
      </el-descriptions>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "StudentInfo",
  setup() {

    return {

    }
  },
  created() {
  },
  data() {
    return {
      select: '',
      search: '',
      dialogVisible: false,
      tableData: [
        {
          no: '1',
          name: '张三',
          major: '数控技术',
          cardno: '610123200212101562',
          phone: '13962358421',
          address: '陕西省汉中市南郑区大河坎镇',
          payable: 1800.00,
          payment: 0,
          status: 2,
          fatherName: '',
          fartherCard: '',
          fatherPhone: '',
          motherName: '',
          motherCard: '',
          motherPhone: '',
        }
      ],
      current: {},
      pay: 0
    }
  },
  methods: {
    handleEdit(index, row) {
      this.current = row
      this.dialogVisible = true
    },
    handleDelete(index, row) {

    },
    saveParent() {
      this.current.status = 3
    }
  }
}
</script>

<style scoped>
</style>